package com.shire.shire_interface.common.utils;

public class KeyValue<K,V> {

    private K key;
    private V value;

    public KeyValue(){

    }

    public KeyValue(K k, V v){
        key = k;
        value = v;
    }

    public K getKey() {
        return key;
    }

    public void setKey(K key) {
        this.key = key;
    }

    public V getValue() {
        return value;
    }

    public void setValue(V value) {
        this.value = value;
    }

    public String toString(){
        return key+":"+value;
    }

    public static <K,V> V getValue(KeyValue<K, V> kv, V v){
        if(kv==null){
            return v;
        }
        V o = kv.getValue();
        return o==null ? v:o;
    }
}
